package com.fleet.schedule;

import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Demo {
    @Scheduled(cron = "0 0/5 * * * ?")
    @SchedulerLock(name = "TaskScheduler_scheduledTask",
            lockAtLeastFor = "PT5M", lockAtMostFor = "PT14M")
    public void run() {
        System.out.println("不会重复执行!!!!!");
    }
}
